<%@ page contentType="text/html; charset=utf-8"%>

<%@include file="../included/commons.jsp"%>
<link href="${base}javascript/jquerys/nyroModal-1.6.2/styles/nyroModal.css" rel="stylesheet" type="text/css" /> 
<script type="text/javascript" src="${base}javascript/jquerys/nyroModal-1.6.2/js/jquery.nyroModal-1.6.2.js"></script> 
<jx:table action="" items="${officeTmps}" var="tmp">
  <jx:tr>
    <jx:td property="name" title="名称"></jx:td>
    <jx:td property="id" title="操作">
    <a href="javascript:;" 
                onclick="deleteTemp('${tmp.id}');return false;"
				target="_blank">删除</a>|
	
	<a href="javascript:;"
	            onclick="viewTemp('${tmp.id}','${tmp.ext}');return false;"
	  			target="_blank">预览</a>
    </jx:td>
  </jx:tr>
</jx:table>

<script type="text/javascript">
<!--
function deleteTemp(id){
	if(!confirm("确认删除!"))return;
    var url = '${base}removemsoffice.action?template.id='+id;
    doAjaxLink(url);
    return false;

}
function viewTemp(id,ext){
	var url = '${base}jsp/template/view.jsp?templateId='+id+'&amp;type='+ext;
	$.nyroModalManual({
	   url: url,
	   closeButton: '<a href="javascript:void(0);" class="nyroModalClose" id="closeBut" title="关闭">关闭</a>'
	});
    return false;
}
$(function(){tbar.removeAll(true);
tbar.addButton( [{
	id : 'btnsave',
	text : '添加模版',
	handler : function(btn, eo) {
		doAjaxLink('${base}jsp/template/add.jsp');
	}
} ]);
tbar.render();
});
//-->
</script>